﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework;
using FarseerPhysics.Dynamics;
using FarseerPhysics.Factories;
using FarseerPhysics.Common;
using FarseerPhysics.Collision.Shapes;

namespace BHG.System
{
    class CubeObject : GameObject
    {
        public CubeObject(Vector2 pos, Vector2 s, float xRot, bool dynamic, Model model, float scale)
            : base(pos, xRot, dynamic, model, CreateShape(s), scale)
        {
        }

        public CubeObject(Vector2 pos, Vector2 s, float xRot, bool dynamic, Model model)
            : base(pos, xRot, dynamic, model, CreateShape(s)) 
        {
        }

        public CubeObject(Vector2 pos, Vector2 s, bool dynamic, Model model)
            : base(pos, 0f, dynamic, model, CreateShape(s))
        {
        }

        public static Shape CreateShape(Vector2 size)
        {
            PolygonShape shape = new PolygonShape(PolygonTools.CreateRectangle(size.X/2, size.Y/2));
            return shape;
        }
    }
}
